package com.LostAndFound.web.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LogoutServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;

	public void adminLogout(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.getSession().removeAttribute("root");
		response.sendRedirect(request.getContextPath() + "/default.jsp");
	}
	public void userLogout(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// 移除用户信息
		request.getSession().removeAttribute("user");
		// 移除myIssue.jsp中存在的myIssueArticleList对象
		request.getSession().removeAttribute("myIssueArticleList");
		response.sendRedirect(request.getContextPath() + "/index.jsp");
	}
}